<?php
class BaseModelError {
    /**
     * error messages
     * @var private mixed
     */
	private $_error = array();
	/**
	 * dump the error parameters
	 * @var private mixed
	 */
	private $_params = array();
	//constructor
	public function __construnct($params = NULL) {
	    $this->_params = $params;
	}
	/**
	 * missing db handle error
	 * @return error template
	 */
	public function missingDBHandle() {
		$this->_error[] = array('message'=>'lost db handle','name'=>'error');
		$this->_output('DBHandle');
	}
	/**
	 * missing logic model
	 * @return error template
	 */
	public function missingModel() {
		$this->_error[] = array('message'=>'error model used','name'=>'error');
		$this->_output('Model');
	}
	/**
	 * missing action method
	 * @return error template
	 */
	public function missingAction() {
		$this->_error[] = array('message'=>'error action query','name'=>'error');
		$this->_output('Action');
	}
	/**
	 * missing controller
	 * @return error template
	 */
	public function missingController() {
		$this->_error[] = array('message'=>'error controller','name'=>'error');
		$this->_output('Controller');
	}
	/**
	 * missing output view template
	 * @return error template
	 */
	public function missingTemplates() {
		$this->_error[] = array('message'=>'no templates like this','name'=>'error');
		$this->_output('Templates');
	}
	/**
	 * output the Error viewer
	 * 
	 * @param string $tplFile
	 * @param string $postfix
	 * @return template
	 */
	private function _output($tplFile, $postfix='.html') {
		$ctrl = new View();
		$ctrl->assign('error',$this->_error);
		$_fn = FOLDER_ERROR.DS.$tplFile.$postfix;
		$ctrl->output($_fn);
	}
}
?>